package org.acghub.mtdb.common;

/**
 * @author zhouhe
 */

public enum Persistence {
    MEMORY,

    DB;

    public static Persistence of(String str) {
        if (str == null || str.isBlank()) {
            return DB;
        }
        for (Persistence value : values()) {
            if (value.name().equalsIgnoreCase(str)) {
                return value;
            }
        }
        throw new IllegalArgumentException("Invalid persistence: " + str);
    }
}